package cn.jingyuan.swan.example.nio;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class InetAddressTest {

    public static void main(String[] args) throws UnknownHostException {

        InetAddress address = InetAddress.getByName("www.baidu.com");

        System.out.println("address = " + address);


        System.out.println("address.getHostAddress() = " + address.getHostAddress());

        byte[] bytes = address.getAddress();

        InetAddress loopbackAddress = InetAddress.getLoopbackAddress();

        System.out.println("loopbackAddress = " + loopbackAddress);
    }

}
